package org.fnzn.service.Impl;

import org.fnzn.service.LrdLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.fnzn.bean.LrdLog;
import org.fnzn.core.Result;
import org.fnzn.mapper.LrdLogMapper;
import org.fnzn.dao.LrdUserMapper;
import org.fnzn.util.DateTools;
import org.fnzn.util.ResultGenerator;

import tk.mybatis.mapper.entity.Condition;
import tk.mybatis.mapper.entity.Example.Criteria;
@Service
public class LrdLogServiceImpl implements LrdLogService {
	@Autowired
	private LrdUserMapper lrdUserMapper;
	@Autowired
	private LrdLogMapper lrdLogMapper;
	@Override
	public Result deleteSysLogByTime() {
		// TODO Auto-generated method stub
		Condition condition = new Condition(LrdLog.class);
		Criteria criteria=condition.createCriteria();
		criteria.andCondition("CRT_TIME <=",DateTools.getCurrentSysData(-30, DateTools.FULLTIME_FORMAT));
		lrdLogMapper.deleteByExample(condition);
		return ResultGenerator.genSuccessResult();
	}
}
